package com.thinkTank.oa.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkTank.oa.base.BaseServiceImpl;
import com.thinkTank.oa.dao.UserDownPersonMapper;
import com.thinkTank.oa.entity.UserDownPerson;
import com.thinkTank.oa.service.UserDownPersonService;

/**
 * 用户下载专家ServiceImpl
 * @author dongli
 * @date 2018年11月7日
 */
@Transactional
@Service("userDownPersonService")
public class UserDownPersonServiceImpl extends BaseServiceImpl<UserDownPerson> implements UserDownPersonService{

	private UserDownPersonMapper userDownPersonMapper;
	
	@Autowired
	public void setUserDownPersonMapper(UserDownPersonMapper userDownPersonMapper){
		this.userDownPersonMapper = userDownPersonMapper;
		super.setBaseMapper(userDownPersonMapper);
	}
	
	/**
	 * 通过用户id和下载时间查询专家的下载数量
	 * @author dongli
	 * @date 2018年11月7日
	 * @param id
	 * @return
	 */
	public Integer findCountByUser(UserDownPerson userDownPerson){
		return userDownPersonMapper.findCountByUser(userDownPerson);
	}
}
